﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IndoReputation.Models.BusinessObject;
using Telerik.Web.Mvc;
using IndoReputation.Models.BusinessLogic;

namespace IndoReputation.Controllers
{
    public class ReporterController : Controller
    {
        //
        // GET: /Reporter/

        public ActionResult Index()
        {
            return View();
        }

        //[GridAction]
        //public ActionResult _SelectAjaxEditing()
        //{
        //    List<Reporter> list;

        //    if (Session["ListReporter"] == null)
        //        list = new List<Reporter>();
        //    else
        //        list = (List<Reporter>)Session["ListReporter"];
        //    return View(new GridModel(list));
        //}
        //[AcceptVerbs(HttpVerbs.Post)]
        
        //[GridAction]
        //public ActionResult _SaveAjaxEditing(Guid id)
        //{
        //    List<Reporter> list = (List<Reporter>)Session["ListReporter"];
        //    Reporter product = list.Where(x => x.IdTemporary == id).SingleOrDefault();
        //    list.Remove(product);
        //    TryUpdateModel(product);
        //    list.Add(product);
        //    Session["ListReporter"] = list;
        //    return View(new GridModel(list));
        //}

        //[AcceptVerbs(HttpVerbs.Post)]
        //[GridAction]
        //public ActionResult _InsertAjaxEditing()
        //{
        //    List<Reporter> list = (List<Reporter>)Session["ListReporter"];
        //    if (list == null)
        //        list = new List<Reporter>();
            
        //    //Create a new instance of the EditableProduct class.
        //    Reporter product = new Reporter();
        //    //Perform model binding (fill the product properties and validate it).
        //    TryUpdateModel(product);
        //    product.IdTemporary = Guid.NewGuid();
        //    list.Add(product);
        //    Session["ListReporter"] = list;
        //    //Rebind the grid
        //    return View(new GridModel(list));
        //}

        //[AcceptVerbs(HttpVerbs.Post)]
        //[GridAction]
        //public ActionResult _DeleteAjaxEditing(Guid id)
        //{
        //    List<Reporter> list = (List<Reporter>)Session["ListReporter"];
        //    list.Remove(list.Where(x => x.IdTemporary == id).SingleOrDefault());            
        //    Session["ListReporter"] = list;
        //    //Rebind the grid
        //    return View(new GridModel(list));
        //}
    }
}
